home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / General / Kamprath's CDEF Pack ƒ / CDEF Sampler Program ƒ / samplerWindow.c < prev    next >
C/C++ Source or Header  |  1994-05-21  |  1KB  |  74 lines

  1. extern SysEnvRec    gMac;
  2.  
  3. /*****
  4.  * samplerWindow.c
  5.  *
  6.  *        The window routines for the Michael Kamprath's CDEF demo
  7.  *
  8.  *      It is based on Symentic's TICK C 5.0 Bullseye demo.
  9.  *
  10.  *****/
  11.  
  12. #include "samplerWindow.h"
  13. #include "samplerControls.h"
  14.  
  15. WindowPtr                samplerWindow;
  16.  
  17. Rect        dragRect;
  18. Rect        windowBounds = { 40, 40, 240, 265 };
  19. Rect        circleStart = {10, 10, 100, 100};
  20. int            width = 5;
  21.  
  22. /****
  23.  * SetUpWindow()
  24.  *
  25.  *    Create the Bullseye window, and open it.
  26.  *
  27.  ****/
  28.  
  29. void SetUpWindow(void)
  30.  
  31. {
  32.  
  33.     dragRect = screenBits.bounds;
  34.  
  35.     if (gMac.hasColorQD)
  36.     {
  37.         samplerWindow = NewCWindow(0L, &windowBounds, "\pCDEF Sampler", 
  38.                                 true, noGrowDocProc, (WindowPtr) -1L, true, 0);
  39.     }
  40.     else
  41.     {
  42.         samplerWindow = NewWindow(0L, &windowBounds, "\pCDEF Sampler", 
  43.                                 true, noGrowDocProc, (WindowPtr) -1L, true, 0);
  44.     }
  45.         
  46.     SetPort(samplerWindow);
  47.     
  48.     
  49.     SetUpWindowCntls();
  50.     
  51. }
  52. /* end SetUpWindow */
  53.  
  54.  
  55. /*****
  56.  * DrawBullseye()
  57.  *
  58.  *    Draws the bullseye.
  59.  *
  60.  *****/
  61.  
  62. void DrawSampleWindow(short active)
  63.  
  64. {    
  65.     SetPort(samplerWindow);
  66.     
  67.     MoveTo(5,10);
  68.     TextSize(9);
  69.     DrawString("\pKamprath's CDEF Package Sampler");
  70.     TextSize(12);
  71.     
  72.     DrawControls(samplerWindow);
  73. }
  74. /* end DrawBullseye */